using System;
using System.Collections.Generic;
using System.Reflection;
using System.Xml.Linq;
namespace MicroMsg.Storage
{
	public abstract class TloXmlItem
	{
		public TloXmlItem()
		{
		}
		public static bool IsEmpty(XElement xelement_0)
		{
			if (xelement_0 != null && !xelement_0.get_IsEmpty())
			{
				bool result;
				using (IEnumerator<XElement> enumerator = xelement_0.Elements().GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						XElement current = enumerator.get_Current();
						if (!current.get_IsEmpty())
						{
							result = false;
							return result;
						}
					}
					return true;
				}
				return result;
			}
			return true;
		}
		public virtual void dump(ref string strInfo)
		{
			strInfo = strInfo + base.GetType().get_Name() + "={";
			FieldInfo[] fields = base.GetType().GetFields(20);
			FieldInfo[] array = fields;
			for (int i = 0; i < array.Length; i++)
			{
				FieldInfo fieldInfo = array[i];
				if (!fieldInfo.get_FieldType().get_IsGenericType() && fieldInfo.get_MemberType() == 4)
				{
					if (fieldInfo.get_FieldType().get_BaseType() == typeof(TloXmlItem))
					{
						TloXmlItem tloXmlItem = fieldInfo.GetValue(this) as TloXmlItem;
						if (tloXmlItem != null)
						{
							tloXmlItem.dump(ref strInfo);
						}
					}
					else
					{
						if (!(fieldInfo.get_Name() == "strUrl") && !(fieldInfo.get_Name() == "strThumb"))
						{
							object obj = strInfo;
							strInfo = string.Concat(new object[]
							{
								obj,
								fieldInfo.get_Name(),
								"=",
								fieldInfo.GetValue(this),
								" "
							});
						}
						else
						{
							string text = fieldInfo.GetValue(this) as string;
							if (string.IsNullOrEmpty(text))
							{
								strInfo = strInfo + fieldInfo.get_Name() + "= ";
							}
							else
							{
								string text2 = strInfo;
								strInfo = string.Concat(new string[]
								{
									text2,
									fieldInfo.get_Name(),
									"=",
									text.Substring(0, 7),
									" "
								});
							}
						}
					}
				}
			}
			strInfo += "}";
		}
		public virtual void dumpObj()
		{
			string text = "";
			this.dump(ref text);
		}
	}
}
